function addEmp(){
	var name = $("#name").val().trim();
	var salary = $("#salary").val().trim();
	var age = $("#age").val().trim();
	console.log(name+":"+salary+":"+age);
	$("waring_name").html("");
	$("waring_sal").html("");
	$("waring_age").html("");
	var flag = true;
	if(name == ""){
		$("#waring_name").html("员工姓名不能为空")
		flag =false;
	}
	if(salary == ""){
		$("#waring_sal").html("员工工资不能为空")
		flag =false;
	}
	if(age == ""){
		$("#waring_age").html("员工年龄不能为空")
		flag =false;
	}
	if(flag){
		$.ajax({
			url:path+"/emp/addEmp.do",
			type:"post",
			data:{"name":name,"salary":salary,"age":age},
			dataType:"json",
			success:function(result){
			if(result.status == 0){	
			window.location.href = "emplist.html"
				}
			},
			error:function(){
				alert("添加失败");
			}	
		})
	}
	
}
